Accusoft.ImagXpress13.ActiveX
Specify a Part of the Image to Process

Prior to performing image processing on an image, you must specify whether the entire image, or a section of the image, should be processed. The ImagXpress® control provides two vehicles for specifying a section of the image to be processed:

If either an Area or a Region are defined, processing will apply only to that Area or Region. If both an Area and a Region are enabled and defined, then the last one to be set will be used.

When RgnEnabled or the Area method's IPArea parameter is True, additional memory is required to store the original image to be merged with the area/region processed. If Area/Region processing is not needed, set RgnEnabled and the Area method's IPArea parameter to False to reduce memory usage.

Region

Creating a Region

To create a region: 

  1. Call RgnDelete to delete the old region.
  2. Define the points in the new region, by calling RgnAddPoint, specifying the coordinates of the next point defining the region. (Points cannot be added once the region has been created.)
  3. Call RgnCreate to create the region. 
A RubberBand can be created to define a rectangular region on the display. First create the rubberband, then use the RubberBandH, RubberBandL, RubberBandT, and RubberBandW properties to populate the X and Y coordinates in RgnAddPoint.

Querying a Region

The RgnX, RgnY, RgnWidth, and RgnHeight properties (read only) provide status on the current position and size of the region. 

Copying the Region to a Sprite

Call RgnCreateSprite to create a Sprite by copying the current region into a transparent window. The sprite can then be moved (RgnMoveSprite) or pasted (RgnPasteSprite) to the image that is currently being viewed. The RgnSpriteX and RgnSpriteY properties define the upper left corner of the rectangle bounding the sprite. If the Viewer is assigned a different image to display, the Sprite remains in effect and can be moved or pasted in the new image being viewed. To delete the sprite and free up the resources associated with it, call RgnDeleteSprite.

Deleting the sprite does not make any changes to the image being viewed.

Enabling the Region for Image Processing

To enable the region, set the RgnEnabled property. When the region has been enabled, all image processing methods act on the region instead of the entire image. When the RegionEnabled property is False, the entire image is processed.

Deleting a Region

To delete a region object and free up the associated memory, call the RgnDelete method (there is no impact on the image). 

Area

An area is a rectangular subset of the image. When the area is enabled (IPArea = true), image processing is performed on the area of the image only.

The RemoveRedeye, RemoveDust, and RemoveScratches methods require that an area be set to specify a subset of the image to process. For all other methods and properties, setting an area is optional.

Creating an Area

To create an Area, call the Area method with a specified rectangular bounding area. Since only one area can be defined for each ImagXpress control, calling Area will delete the previous area.

A RubberBand can be created to define a rectangular region on the display. First create the rubberband, then use the RubberbandH, RubberBandL, RubberBandT, and RubberBandW properties to populate the coordinates in Area.

Querying an Area

The size, location, and status of an area can be identified, using the following properties: IPAreaX, IPAreaY, IPAreaWidth, IPAreaHeight and IPArea.

Copying the Area to a Sprite

A Sprite cannot be created from an Area. To create a sprite, first copy the area to a region, then create the sprite. 

Deleting an Area

Calling the Area method will replace the current area with a newly defined area. 

See Also

 

 


©2019. Accusoft Corporation. All Rights Reserved.

Send Feedback